package rdb.model;

public class StringObject extends BaseObject {
    private byte[] value;

    public StringObject(BaseObject baseObject, byte[] val) {
        super(baseObject);
        value = val;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder("String: ");
        sb.append(new String(value)).append("\n");
        return sb.toString();
    }

    @Override
    public Object getValue() {
        return new String(value);
    }

    @Override
    public String[] getCmdLines() {
        return new String[]{
                "set", getKey(), new String(value)
        };
    }
}
